/*
 * Virtual file system, astrazione del filesystem virtuale
 */

#ifndef FS_VFS_H
#define FS_VFS_H

#include <klibc/ctype.h>
#include <shell/shell.h>
//#include <system/mod.h>

#include "inode.h"

#define VFS_OK						1
#define VFS_ER_UMOUNT_NOT_PRESENT	2
#define VFS_ER_UMOUNT_DEV			3
#define VFS_ER_MOUNT_BAD_FS			10
#define VFS_ER_MOUNT_BAD_DEV		11
#define VFS_ER_MOUNT_BAD_MPOINT		12



vfs_node_t *vfs_fs_list;
vfs_node_t *vfs_root;
vfs_node_t *vfs_mounted;

void vfs_init();

void 	vfs_add_fs(vfs_node_t *);
uint8_t vfs_check_fs(char *);

void vfs_mount_command();
void vfs_show_tree(vfs_node_t *, uint32_t);
uint32_t vfs_mount(char *, char *, char *);

vfs_node_t *vfs_get_mount_point(char *);
vfs_node_t *vfs_get_node(char *path);

uint32_t	vfs_read(vfs_node_t *, char *, uint32_t, uint64_t);
uint32_t	vfs_write(vfs_node_t *, char *, uint32_t, uint64_t);
void		vfs_open(vfs_node_t *);
void		vfs_close(vfs_node_t *);
uint8_t		vfs_readdir(vfs_node_t *, char *, uint32_t);
vfs_node_t	*vfs_finddir(vfs_node_t *, char *);


#endif
